home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1997 / MacHack 1997.toast / Hacks / Hacks ’97 / Warrior’s Progress / source code / Source / Libraries / Activation / Activator.h < prev    next >
Encoding:
Text File  |  1997-06-28  |  690 b   |  47 lines  |  [TEXT/CWIE]

  1. // Activator.h
  2.  
  3. #ifndef Activator_h
  4. #define Activator_h
  5.  
  6. #ifndef Enableable_h
  7. #include "Enableable.h"
  8. #endif
  9. #ifndef ListLink_h
  10. #include "ListLink.h"
  11. #endif
  12. #ifndef ContextUser_h
  13. #include "ContextUser.h"
  14. #endif
  15.  
  16. class Focus;
  17.  
  18. class Activator: public ContextUser,
  19.                       public Enableable
  20.   {
  21.     friend class Focus;
  22.     
  23.     private:
  24.         bool active;
  25.         bool focusActive;
  26.         
  27.         ListLink< Activator > link;
  28.     
  29.         void FocusActivated();
  30.         void FocusDeactivated();
  31.     
  32.     protected:
  33.         virtual void Activate()     {}
  34.         virtual void Deactivate()     {}
  35.  
  36.         virtual void BeEnabled();
  37.         virtual void BeDisabled();
  38.         
  39.     public:
  40.         Activator( Focus& );
  41.         ~Activator();
  42.         
  43.         bool Active() const        { return active; }
  44.   };
  45.  
  46. #endif
  47.